import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/tabbar',
  },
  {
    path: '/tabbar',
    component: () => import('@/views/tabbar.vue'),
    children: [
      {
        path: '/tabbar',
        redirect: '/tabbar/home',
      },
      {
        path: 'home',
        name:'首页',
        meta:{title:'首页'},
        component: () => import('@/views/pages-1/home.vue')
      },
      {
        path: 'state',
        name:'动态',
        meta:{title:'动态'},
        component: () => import('@/views/pages-1/state.vue')
      },
      {
        path: 'shop',
        name:'会员购',
        meta:{title:'会员购'},
        component: () => import('@/views/pages-1/shop.vue')
      },
      {
        path: 'my',
        name:'我的',
        meta:{title:'我的'},
        component: () => import('@/views/pages-1/my.vue')
      },
    ]
  },
  {
    path: '/show',
    name: 'show',
    component: () => import('@/views/show.vue')
  },
  {
    path: '/search',
    name:'搜索',
    meta:{title:'搜索'},
    component: () => import('@/views/search.vue')
  },
  {
    path: '/searchimg',
    name:'搜索结果',
    meta:{title:'搜索结果'},
    component: () => import('@/views/searchimg.vue')
  },
  {
    path:'/login',
    name:'登录',
    meta:{title:'登录'},
    component:() => import('@/views/login.vue')
  },
  {
    path:'/register',
    name:'注册',
    meta:{title:'注册'},
    component:() => import('@/views/register.vue')
  },
  {
    path:'/add',
    name:'稿件上传',
    meta:{title:'稿件上传'},
    component:() => import('@/views/add.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
